import request from '@/utils/request'

// 查询问卷调查作答列表
export function listEnroll(query) {
  return request({
    url: '/questionnaire/enroll/list',
    method: 'get',
    params: query
  })
}

// 查询问卷调查作答详细
export function getEnroll(answerId) {
  return request({
    url: '/questionnaire/enroll/' + answerId,
    method: 'get'
  })
}

// 新增问卷调查作答
export function addEnroll(data) {
  return request({
    url: '/questionnaire/enroll',
    method: 'post',
    data: data
  })
}

// 修改问卷调查作答
export function updateEnroll(data) {
  return request({
    url: '/questionnaire/enroll',
    method: 'put',
    data: data
  })
}

// 删除问卷调查作答
export function delEnroll(answerId) {
  return request({
    url: '/questionnaire/enroll/' + answerId,
    method: 'delete'
  })
}

//保存问卷
export function saveValues(data,questionnaireId){
  return request({
    url: '/questionnaire/enroll/saveValues/'+questionnaireId,
    method: 'post',
    data: data
  })
}

//查看回传问卷
export function selectIsAnswer(query){
  return request({
    url: '/questionnaire/enroll/isAnswer',
    method: 'get',
    params: query
  })
}

